<template>
    <div>

        <treeItem v-for="(item, index) in treeData" :key="index" :item="item"/>
    </div>
</template>

<script>
import treeItem from './TreeItem.vue'
export default {
    components: {
        treeItem
    },
    data() {
        return {
            treeData: [
                {
                    name: "中国",
                    eng: "China",
                    children: [
                        {
                            name: "北京",
                            eng: "Beijing",
                        },
                        {
                            name: "上海",
                            eng: "Shanghai",
                            children: [
                                {
                                    name: "闵行区",
                                    eng: "Minhang",
                                },
                                {
                                    name: "静安区",
                                    eng: "Jingan",
                                },
                            ],
                        },
                    ],
                }, {
                    name: "美国",
                    eng: "American",
                    children: [
                        {
                            name: "纽约",
                            eng: "NewYork",
                            children: [
                                {
                                    name: "曼哈顿区",
                                    eng: "ManHattan",
                                },
                                {
                                    name: "皇后区",
                                    eng: "Queen",
                                },
                                {
                                    name: "布鲁克林区",
                                    eng: "Brooklyn",
                                },
                            ],
                        },
                        {
                            name: "华盛顿",
                            eng: "Washington",
                        },
                    ],
                },
            ],
        }
    },
}
</script>

<style scoped lang="less"></style>